import { storage } from "@/utils/storage";
import { MALL_SEARCH_HISTORY_RECORD } from "@/store/mutation-types";

const state = {
    searchHistoryRecord: storage.get(MALL_SEARCH_HISTORY_RECORD, []), // 商品搜索的历史记录
};

const mutations = {
    // 设置课程搜索的历史记录
    setSearchHistoryRecord(state, data) {
        state.searchHistoryRecord = data;
        storage.set(MALL_SEARCH_HISTORY_RECORD, data);
    },
};

export default {
    namespaced: true,
    state,
    mutations,
};
